package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;

import java.util.List;

public class ReservationPageBO implements PickableBean {

    public static final String FN_ORDERID = "orderId";
    public static final String FN_CREATETIME = "createTime";
    public static final String FN_SHOPDATE = "shopDate";
    public static final String FN_SHOPTIME = "shopTime";
    public static final String FN_SERVICE = "service";
    public static final String FN_STATUS = "status";
    public static final String FN_SHOPID = "shopId";
    public static final String FN_SHOPNAME = "shopName";
    public static final String FN_COUNT = "count";
    public static final String FN_REMARK = "remark";

    public static final List<String> FIELD_NAMES = Lists.newArrayList(
            FN_ORDERID,
            FN_CREATETIME,
            FN_SHOPDATE,
            FN_SHOPTIME,
            FN_SERVICE,
            FN_STATUS,
            FN_SHOPID,
            FN_SHOPNAME,
            FN_COUNT,
            FN_REMARK);

    private String orderId;
    private Long createTime;
    private String shopDate;
    private String shopTime;
    private String service;
    private String status;
    private String shopId;
    private String shopName;
    private Integer count;
    private String remark;

    public ReservationPageBO(String orderId, Long createTime, String shopDate, String shopTime, String service, String status, String shopId, String shopName, Integer count, String remark) {
        setOrderId(orderId);
        setCreateTime(createTime);
        setShopDate(shopDate);
        setShopTime(shopTime);
        setService(service);
        setStatus(status);
        setShopId(shopId);
        setShopName(shopName);
        setCount(count);
        setRemark(remark);
    }

    public ReservationPageBO() {
    }

    public ReservationPageBO duplicate() {
        ReservationPageBO result = new ReservationPageBO();
        result.orderId = this.orderId;
        result.createTime = this.createTime;
        result.shopDate = this.shopDate;
        result.shopTime = this.shopTime;
        result.service = this.service;
        result.status = this.status;
        result.shopId = this.shopId;
        result.shopName = this.shopName;
        result.count = this.count;
        result.remark = this.remark;
        return result;
    }

    @Override
    public String toString() {
        return Convert.toJson(this);
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String value) {
        this.orderId = value;
    }

    public ReservationPageBO withOrderId(String value) {
        setOrderId(value);
        return this;
    }

    public ReservationPageBO withOrderId(String value, String defaultValue) {
        setOrderId(value == null ? defaultValue : value);
        return this;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long value) {
        this.createTime = value;
    }

    public ReservationPageBO withCreateTime(Long value) {
        setCreateTime(value);
        return this;
    }

    public ReservationPageBO withCreateTime(Long value, Long defaultValue) {
        setCreateTime(value == null ? defaultValue : value);
        return this;
    }

    public String getShopDate() {
        return shopDate;
    }

    public void setShopDate(String value) {
        this.shopDate = value;
    }

    public ReservationPageBO withShopDate(String value) {
        setShopDate(value);
        return this;
    }

    public ReservationPageBO withShopDate(String value, String defaultValue) {
        setShopDate(value == null ? defaultValue : value);
        return this;
    }

    public String getShopTime() {
        return shopTime;
    }

    public void setShopTime(String value) {
        this.shopTime = value;
    }

    public ReservationPageBO withShopTime(String value) {
        setShopTime(value);
        return this;
    }

    public ReservationPageBO withShopTime(String value, String defaultValue) {
        setShopTime(value == null ? defaultValue : value);
        return this;
    }

    public String getService() {
        return service;
    }

    public void setService(String value) {
        this.service = value;
    }

    public ReservationPageBO withService(String value) {
        setService(value);
        return this;
    }

    public ReservationPageBO withService(String value, String defaultValue) {
        setService(value == null ? defaultValue : value);
        return this;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String value) {
        this.status = value;
    }

    public ReservationPageBO withStatus(String value) {
        setStatus(value);
        return this;
    }

    public ReservationPageBO withStatus(String value, String defaultValue) {
        setStatus(value == null ? defaultValue : value);
        return this;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String value) {
        this.shopId = value;
    }

    public ReservationPageBO withShopId(String value) {
        setShopId(value);
        return this;
    }

    public ReservationPageBO withShopId(String value, String defaultValue) {
        setShopId(value == null ? defaultValue : value);
        return this;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String value) {
        this.shopName = value;
    }

    public ReservationPageBO withShopName(String value) {
        setShopName(value);
        return this;
    }

    public ReservationPageBO withShopName(String value, String defaultValue) {
        setShopName(value == null ? defaultValue : value);
        return this;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer value) {
        this.count = value;
    }

    public ReservationPageBO withCount(Integer value) {
        setCount(value);
        return this;
    }

    public ReservationPageBO withCount(Integer value, Integer defaultValue) {
        setCount(value == null ? defaultValue : value);
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String value) {
        this.remark = value;
    }

    public ReservationPageBO withRemark(String value) {
        setRemark(value);
        return this;
    }

    public ReservationPageBO withRemark(String value, String defaultValue) {
        setRemark(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        switch (name) {
            case "orderId":
                return getOrderId();
            case "createTime":
                return getCreateTime();
            case "shopDate":
                return getShopDate();
            case "shopTime":
                return getShopTime();
            case "service":
                return getService();
            case "status":
                return getStatus();
            case "shopId":
                return getShopId();
            case "shopName":
                return getShopName();
            case "count":
                return getCount();
            case "remark":
                return getRemark();
        }
        return null;
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    @Override
    public int hashCode() {
        return signature().hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof ReservationPageBO)) return false;
        return signature().equals(((ReservationPageBO) o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean ReservationPageBO has no signature defined, no hash code or equals possible.");
    }
}
